package net.pimpas.web.jsf.components.simplemenu.impl;

import net.pimpas.web.jsf.components.simplemenu.SimpleMenuItem;

public class SimpleMenuItemImpl extends SimpleMenuElementImpl implements SimpleMenuItem {

	private static final long serialVersionUID = -8882816168495202403L;
	
	public SimpleMenuItemImpl(String name) {
		super(name);
	}
	
	@Override
	public String toString() {
		return "var "+this.getName()+" = new simpleMenuItemIcon("+((this.getIcon() != null) ? "'"+this.getIcon()+"'" : "null")+"," +
		((this.getIconHover() != null) ? "'"+this.getIconHover()+"'" : "null")+"," +
				"'"+this.getLabel()+"', '"+this.getAction()+"', " +
		((this.getTooltip() != null) ? "'"+this.getTooltip()+"'" : "' '")+
		((this.getParent() != null) ? ","+this.getParent().getName() : "") + ");";
	}
}